<template>
  <view class="personality-feature">
    <view class="title-img-box">
      <image class="title-img" :src="partTextImgUrl" />
    </view>
    <view class="content-wrapper">
      <view class="content">
        <view class="icon-bar">
          <view
            class="icon-item"
            v-for="(item, index) in dataItem.content"
            :key="index"
          >
            <image :src="item.url" class="icon"></image>
            <text class="icon-text">{{ item.label }}</text>
          </view>
        </view>
        <view class="desc">
          {{ dataItem.desc }}
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    dataItem: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      partTextImgUrl:
        this.$imgBaseSelf + 'career/careerAssessNewImg/02_title.png',
      imgPavilion:
        this.$imgBaseSelf + 'career/careerAssessResult/img_pavilion.png'
    };
  },
  mounted() {
    uni
      .createSelectorQuery()
      .in(this)
      .select('.personality-feature')
      .boundingClientRect((rect) => {
        this.$emit('listenRect', rect);
      })
      .exec();
  }
};
</script>

<style lang="scss" scoped>
.personality-feature {
  margin-top: 48rpx;
  position: relative;
  background: url($img-base + 'career/careerAssessNewImg/02_bg.png') no-repeat
    100% 17%;
  width: 100%;
  .title-img-box {
    display: flex;
    justify-content: flex-end;
    .title-img {
      height: 112rpx;
      width: 470rpx;
    }
  }

  .content-wrapper {
    margin: -14rpx 32rpx 0 32rpx;
    background: #fff;
    border-radius: 20rpx 0rpx 0rpx 0rpx;
    .content {
      padding: 53rpx 42rpx 42rpx 42rpx;
      background: linear-gradient(0deg, #ffffff 0%, #ffe0a9 98%) no-repeat;
      border-radius: 20rpx 0rpx 0rpx 0rpx;
      border: 1px solid #ffffff;
      background-size: 100% 83rpx;
      .icon-bar {
        display: flex;
        justify-content: space-between;
        margin: 0 0 55rpx 0;
        .icon-item {
          display: flex;
          flex-direction: column;
          align-items: center;
          .icon {
            width: 139rpx;
            height: 139rpx;
            border-radius: 50%;
            margin-bottom: 30rpx;
          }
          .icon-text {
            font-family: Source Han Sans CN;
            font-weight: 600;
            font-size: 32rpx;
            color: #222222;
          }
        }
      }
      .desc {
        font-family: Source Han Sans CN;
        font-size: 30rpx;
        color: #888888;
        line-height: 48rpx;
      }
    }
  }
}
</style>
